import QtQuick 2.0

Row {
    spacing: 50
    AnimationImageV1 {
        id: ufo_1
        y: 300
        text: "Property Animation"
        // 基础动画
        NumberAnimation on y {
            id: y_anim
            running: false
            to: 40
            duration: 3000
            easing.type: Easing.InOutQuart
        }
        onClicked: {
            y = 300
            y_anim.start()
        }
    }
    AnimationImageV1 {
        id: ufo_2
        y: 300
        text: "Behavior on Animation"
        // 值改变时使用动画
        Behavior on y {
            NumberAnimation {
                duration: 3000
                easing.type: Easing.InOutQuart
            }
        }
        onClicked: {
            if (y == 300)
                y = 40
            else
                y = 300
        }
    }
    AnimationImageV1 {
        id: ufo_3
        y: 300
        text: "Standalone on Animation"
        // 独立动画可使用start(),resume(),stop()控制
        NumberAnimation {
            id: anim
            target: ufo_3
            property: "y"
            from: 300
            to: 40
            duration: 3000
            easing.type: Easing.InOutQuart
        }
        onClicked: anim.start()
    }
}
